package com.personalsystem.login.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.personalsystem.common.bean.NavigationTree;
import com.personalsystem.login.bean.PersonalInfo;
import com.personalsystem.login.dao.LoginDao;
import com.personalsystem.login.service.LoginService;
import com.personalsystem.tool.hibernate.BaseDao;
import com.personalsystem.tool.hibernate.BaseManagerImpl;


@Component("loginService")
public class LoginServiceImpl extends BaseManagerImpl<PersonalInfo> implements LoginService{
	
	@Autowired
	@Qualifier("loginDao")
	private LoginDao loginDao;
	
	@Override
	protected BaseDao<PersonalInfo> getDao() {
		// TODO Auto-generated method stub
		return loginDao;
	}
	
	public void insertX(){
		try{
		loginDao.insert();
		PersonalInfo info=new PersonalInfo();
		loginDao.insertB();
		}catch (Exception e) {
			// TODO: handle exception
			throw new RuntimeException(e.getMessage());
		}
	}

	public List<NavigationTree> loadTree(long id) {
		
		List<NavigationTree> treeList=loginDao.loadTree(id);
		return treeList;
		
	}

}
